
<html>
<head>
  <meta charset="UTF-8">
  <title>angular-demo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body>
  <h1>A lazyload service for angular projects, only load-on-demand, support seajs/requirejs/custom.</h1>
  <div>
    <a href="#main">main</a> | <a href="#test/a">testA</a> | <a href="#test/b/123">testB</a>
  </div>
  <!-- route container -->
  <div data-ng-view data-ng-cloak id="view"></div>

  <script src="components/seajs/dist/sea.js"></script>
  <script src="components/seajs/dist/seajs-text.js"></script>
  <script src="components/seajs/dist/seajs-css.js"></script>
  <script>
    var domain = 'http://127.0.0.1:8888/demo/app/';
    seajs.config({
          alias: { 
                "angularjs" : "components/angular/angular.js", 
                "angular-route" : "components/angular-route/angular-route.js",
                "angular-lazyload" : "components/angular-lazyload/angular-lazyload.js"
          },

          preload: [],

          paths: {},

          vars: {
                'resourceUrl': domain+'resource/',
                'apiUrl': domain+'api/'
                //'apiAccessUrl': domain+'/apis/'+getCookie('session_id')+'/'
          },

          'map': [
                  [/^(.*\.(?:css|js))(.*)$/i, '$1?v='+Math.random()]
                  //[/^(.*\.(?:css|js))(.*)$/i, '$1?v=1.0']
          ],
                 
          debug: true,
              
          base: domain,
              
          charset: 'utf-8'
    });
            
    //入口尽量简单
    seajs.use(['./app','angularjs'],function(app){
        window.onload = function(){
          angular.bootstrap(document, ['app']);
        }
    })

  </script>
</body>
</html>
